<%--
  Created by IntelliJ IDEA.
  User: cyy
  Date: 2020/3/24
  Time: 17:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<c:set var="ctx" value="<%=basePath%>"  />
<html>
<head>
    <title>积分管理</title>
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/bootstrapTable/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/toastr/toastr.min.css">
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="/static/bootstrapTable/bootstrap-table.min.js"></script>
    <script src="/static/bootstrapTable/bootstrap-table-zh-CN.min.js"></script>
    <script src="/static/toastr/toastr.min.js"></script>
    <script src="/static/js/admin/admin_integral.js"></script>
    <style type="text/css">
        /*只显示纵向滑动条*/
        html { overflow-x: hidden; overflow-y: hidden; }
        /*striped : true 不生效
        nth-child 选择器匹配属于其父元素的第 N 个子元素*/
        #loadTable tr:nth-child(even){
            background: #F0F8FF;
        }
        #loadTable tr:nth-child(odd){
            background: #F0FFFF;
        }
        /*只显示纵向滑动条*/
        html {
            overflow-x: hidden;
            overflow-y: hidden;
        }
        .table > tbody > tr > td{
            padding: 1px
        }
        img{
            width:34px;
            height:34px;
        }
        img:hover{
            width:64px;
            height:64px;
        }
    </style>
    <script type="application/javascript">
        var ctx= '${ctx}';
        console.info("桃子大水阿比"+ctx)
    </script>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading">
        查询条件
    </div>
    <div class="panel-body form-group" style="margin-bottom:0px;">
        <label class="col-md-1 control-label" style="text-align: right; margin-top:5px">库存：</label>
        <div class="col-md-2">
            <input type="text" class="form-control" name="Name" id="reverse" autocomplete="off"/>
        </div>
        <label class="col-md-2 control-label" style="text-align: right; margin-top:5px">兑换积分：</label>
        <div class="col-md-2">
            <select class="form-control" id="sel1">
                <option value="">全部</option>
                <option value= 1>低于19999</option>
                <option value= 2>20000-49999</option>
                <option value= 3>50000-100000</option>
            </select>
        </div>
        <div class="col-md-2">
            <button class="btn btn-primary pull-right" id="search_btn">查询</button>
        </div>
        <div class="col-md-2">
            <button class="btn btn-primary pull-right" id="addCommodity_btn" data-toggle="modal" data-target="#AddModal">添加商品</button>
        </div>
     <%--   <div class="col-md-2">
            <button class="btn btn-primary pull-right" id="EditCommodity_btn" data-toggle="modal" data-target="#EditModal">添加商品</button>
        </div>--%>
    </div>
</div>
<table id="loadTable" class="table table-hover"></table>

<!-- 修改模态框 -->
<div class="modal fade" id="EditModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">修改信息框</h4>
            </div>
            <form class="form-horizontal" role="form" id="edityan" enctype="multipart/form-data" method="post">
                <input type="hidden" id="exchangeId">
                <div class="modal-body" >
                    <div class="form-group">
                        <label  class="col-md-3 control-label">商品图片:</label>
                        <div class="col-md-6">
                            <input type="file" <%--id="commodityPicEdit"--%> name="file" class="form-control" autocomplete="off" />
                        </div>
                        <div class="col-md-2">
                            <img  id="newLoc"  />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">商品介绍:</label>
                        <div class="col-md-8">
                                <textarea rows="3" id="commodityDesEdit" class="form-control">
                                </textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">商品库存:</label>
                        <div class="col-md-8">
                            <input type="text" id="reserveEdit" class="form-control" autocomplete="off" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">兑换所需积分:</label>
                        <div class="col-md-8">
                            <input type="text" id="commodityIntegralEdit" class="form-control" autocomplete="off" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">兑换所需Vip等级:</label>
                        <div class="col-md-8">
                            <select class="form-control" id="vip">
                                <option  value=0>0</option>
                                <option value= 10000>1</option>
                                <option value= 20000>2</option>
                                <option value= 50000>3</option>
                                <option value= 100000>4</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="EditActive">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>

<%--添加商品模态框--%>
<div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="scanInfoModalLabel">添加兑换商品</h4>
            </div>
            <form class="form-horizontal" role="form" id="yanzheng" enctype="multipart/form-data" method="post">
                <div class="modal-body" >
                        <div class="form-group">
                            <label  class="col-md-3 control-label">商品图片:</label>
                            <div class="col-md-8">
                                <input type="file" id="commodityPic" name="file" class="form-control" autocomplete="off" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">商品介绍:</label>
                            <div class="col-md-8">
                                <textarea rows="3" id="commodityDes" class="form-control">
                                </textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">商品库存:</label>
                            <div class="col-md-8">
                                <input type="text" id="reserve" class="form-control" autocomplete="off" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">兑换所需积分:</label>
                            <div class="col-md-8">
                                <input type="text" id="commodityIntegral" class="form-control" autocomplete="off" />
                            </div>
                        </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">兑换所需Vip等级:</label>
                        <div class="col-md-8">
                            <select class="form-control" id="vipScore">
                                <option value=0>0</option>
                                <option value= 10000>1</option>
                                <option value= 20000>2</option>
                                <option value= 50000>3</option>
                                <option value= 100000>4</option>
                            </select>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="addActive">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 删除模态框 -->
<div class="modal fade" id="DeleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel1">彻底删除</h4>
            </div>
            <div class="modal-body" id="active">

                <input type="hidden" id="deleteCom">
                <span>确定彻底删除商品吗?</span>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="deleActive">删除</button>
            </div>
        </div>
    </div>
</div>

</body>
</html>

